/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package landapplication;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 */
public class LandApplication {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        excutePost("http://localhost:8080/land/", "");
    }

    public static void excutePost(String targetURL, String urlParameters) {
        try {
            String servlet = targetURL;
            String query = "act=1&id=350";
            java.net.URL url = new java.net.URL(servlet);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            ((URLConnection )conn).setDoOutput(true);
            PrintWriter writer = new PrintWriter(conn.getOutputStream(), true);
            BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
            while (reader.ready()) {
                System.out.print(reader.read());
            }
        } catch (MalformedURLException ex) {
            Logger.getLogger(LandApplication.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(LandApplication.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
